myApp.controller('urllistController', function ($scope, $uibModal, $stateParams, ngDialog, $http, $filter, $interval, $timeout, $rootScope) {
    $scope.info.recoverProject = '';
    $scope.reloadConfigFile = function () {
        openDialog(ngDialog, $scope, "确定要重新加载配置文件吗?", true, function (val) {
            if (!val) {
                return;
            }
            $http.get(java_url + '/beetle/common/reloadConfigFile?tokenId=' + getTokenId()).success(function (data) {
                alert(JSON.stringify(data));
            })
        });
    };
    $scope.reloadJumpSSHServer = function () {
        openDialog(ngDialog, $scope, "确定要重置跳板机对象吗?", true, function (val) {
            if (!val) {
                return;
            }
            $http.get(java_url + '/beetle/jumpServer/reloadJumpSSHServer?tokenId=' + getTokenId()).success(function (data) {
                alert(JSON.stringify(data));
            })
        });
    };
    $scope.autoDeployWho = function () {
        openDialog(ngDialog, $scope, "确定要发布who吗?", true, function (val) {
            if (!val) {
                return;
            }
            $http.get(java_url + '/beetle/deploy/autoDeployWho?tokenId=' + getTokenId()).success(function (data) {
                alert(JSON.stringify(data));
            })
        });
    };
    $scope.cleanProject = function () {
        openDialog(ngDialog, $scope, "确定要清理磁盘吗?", true, function (val) {
            if (!val) {
                return;
            }
            $http.get(java_url + '/beetle/common/cleanProject?tokenId=' + getTokenId()).success(function (data) {
                alert(JSON.stringify(data));
            })
        });
    };
    $scope.recoverProject = function () {
        openDialog(ngDialog, $scope, "确定要恢复工程" + $scope.info.recoverProject + "吗?", true, function (val) {
            if (!val) {
                return;
            }
            $http.get(java_url + '/beetle/common/recoverProject?tokenId=' + getTokenId() + '&projectName=' + $scope.info.recoverProject).success(function (data) {
                alert(JSON.stringify(data));
            })
        });
    };
});